<!doctype html>
<html>
    <head>
        <title>数组求和</title>
        <meta charset="utf-8" />
    </head>
    <body>
       <script src="../defun.js"></script> 
       <script>
        var sum = defun({
            "[]":0,
            "(x:xs)":(x,xs)=>x+sum(xs)
        });
        document.write("<h3>数组求和[1,2,3,4,5]</h3>");
        document.write(sum([1,2,3,4,5]));
        document.write("<h3>数组求和[18,21,88,4,5]</h3>");
        document.write(sum([18,21,88,4,5]));
       </script>
    </body>
</html>
